package com.acwing.partition12;

import java.io.*;

/**
 * @author `RKC`
 * @date 2022/1/9 9:17
 */
public class AC1126最小花费 {

    private static final int N = 2010;
    private static double[][] graph = new double[N][N];
    private static int n = 0, m = 0;

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        String[] s = reader.readLine().split("\\s+");
        n = Integer.parseInt(s[0]);
        m = Integer.parseInt(s[1]);
        for (int i = 0; i < m; i++) {
            s = reader.readLine().split("\\s+");
            int u = Integer.parseInt(s[0]), v = Integer.parseInt(s[1]), w = Integer.parseInt(s[2]);
            graph[u][v] = graph[v][u] = (100.0 - w) / 100;
        }
        s = reader.readLine().split("\\s+");
        int start = Integer.parseInt(s[0]), end = Integer.parseInt(s[1]);
        writer.write(String.format("%.8f", dijkstra(start, end)));
        writer.flush();
    }

    private static double dijkstra(int start, int end) {
        double[] dist = new double[n + 1];
        boolean[] visited = new boolean[n + 1];
        dist[start] = 1;
        for (int k = 0; k < n; k++) {
            int u = -1;
            for (int i = 1; i <= n; i++) {
                if (!visited[i] && (u == -1 || dist[u] < dist[i])) u = i;
            }
            visited[u] = true;
            for (int i = 1; i <= n; i++) {
                dist[i] = Math.max(dist[i], dist[u] * graph[u][i]);
            }
        }
        return 100 / dist[end];
    }
}
